 /* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
    line-height: 1.6;
    background-color: #f2f9f1; /* 更清新的浅绿色背景 */
    color: #333;
}

a {
    text-decoration: none;
    color: #333;
}

/* 导航栏样式 */
.main-nav {
    background-color: #27ae60; /* 深绿色导航栏 */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 10px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo h1 {
    color: #ffffff; /* 白色logo，在深绿背景上更显眼 */
    font-size: 24px;
    font-weight: bold;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    padding: 8px 15px;
    border-radius: 4px;
    transition: all 0.3s;
    color: #ffffff; /* 白色导航链接 */
    font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: rgba(255, 255, 255, 0.2); /* 半透明白色悬停效果 */
    color: #ffffff;
}

.search-box {
    display: flex;
    gap: 10px;
}

.search-box input {
    padding: 8px 12px;
    border: none;
    border-radius: 4px 0 0 4px;
    width: 200px;
    font-size: 14px;
}

.search-box button {
    background-color: #ff9933; /* 橙色搜索按钮 */
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-box button:hover {
    background-color: #e67e22; /* 深橙色悬停效果 */
}

/* 主要内容区域 */
main {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    background-color: #fff5eb;
    height: auto;
}

/* Banner区域 */
.banner {
    background: linear-gradient(135deg, #a3e4d7, #dff9fb); /* 渐变背景 */
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 300px;
}

.banner-content h2 {
    color: #333;
    margin-bottom: 20px;
}

.banner-games {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 0;
}

.game-card {
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #f0f0f0;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.game-card img {
    width: 100%;
    height: auto;
    display: block;
}

.game-card h3 {
    padding: 10px;
    font-size: 16px;
    color: #333;
}

.game-card p {
    padding: 0 10px 10px;
    color: #666;
    font-size: 14px;
}

/* 游戏分类区域 */
.game-categories {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.category-card {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: transform 0.3s;
}

.category-card:hover {
    transform: translateY(-5px);
}

.category-card img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 10px;
}

/* 最新游戏区域 */
.new-games {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* 页脚样式 */
footer {
    background: #222222; /* 深灰色背景，不那么刺眼 */
    color: #ffffff;
    padding: 25px 0 15px; /* 减小上下内边距 */
    margin-top: 30px; /* 减小顶部外边距 */
    box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

/* 添加微妙的图案背景 */
footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25px 25px, rgba(255, 255, 255, 0.07) 2px, transparent 0),
        radial-gradient(circle at 75px 75px, rgba(255, 255, 255, 0.07) 2px, transparent 0);
    background-size: 100px 100px;
    opacity: 0.3;
    z-index: 1;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px; /* 减小间隙 */
    padding: 0 30px; /* 减小左右内边距 */
    position: relative;
    z-index: 2;
}

.footer-section {
    padding: 0 12px;
    position: relative;
    margin-bottom: 5px;
}

.footer-section h4 {
    color: #ffffff;
    margin-bottom: 15px; /* 减小下外边距 */
    font-size: 18px; /* 减小字体大小 */
    position: relative;
    display: inline-block;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -6px; /* 调整下划线位置 */
    width: 40px;
    height: 2px; /* 减小高度 */
    background-color: #ff9933; /* 橙色下划线 */
    border-radius: 2px;
    transition: width 0.3s ease;
}

.footer-section:hover h4::after {
    width: 60px;
}

.footer-section ul {
    list-style: none;
    margin-left: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-section ul li {
    margin-bottom: 0;
    position: relative;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.75);
    transition: all 0.3s;
    display: inline-block;
    padding-left: 0;
    font-size: 14px;
    position: relative;
    white-space: nowrap;
}

.footer-section a::before {
    content: '›';
    position: absolute;
    left: -12px;
    opacity: 0;
    transition: all 0.3s;
}

.footer-section a:hover {
    color: #ff9933;
    padding-left: 10px;
}

.footer-section a:hover::before {
    opacity: 1;
    left: 0;
}

.social-links {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px; /* 减小尺寸 */
    height: 35px; /* 减小尺寸 */
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-radius: 50%;
    transition: all 0.3s;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.social-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ff9933; /* 橙色填充 */
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.4s ease;
    z-index: -1;
}

.social-links a:hover {
    color: #ffffff;
    transform: translateY(-3px);
    padding-left: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.social-links a:hover::before {
    transform: scale(1);
    opacity: 1;
}

.copyright {
    text-align: center;
    margin-top: 20px; /* 减小上外边距 */
    padding-top: 15px; /* 减小上内边距 */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px; /* 减小字体大小 */
    position: relative;
    z-index: 2;
}

.copyright p {
    margin: 0;
    line-height: 1.6;
    letter-spacing: 0.5px;
}

.copyright::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px; /* 减小宽度 */
    height: 2px;
    background-color: #ff9933; /* 橙色分隔线 */
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-nav {
        flex-direction: column;
        padding: 10px;
    }

    .nav-links {
        margin: 15px 0;
        flex-wrap: wrap;
        justify-content: center;
    }

    .search-box {
        width: 100%;
        justify-content: center;
    }

    .search-box input {
        width: 60%;
    }

    .banner-games {
        flex-direction: column;
    }

    .category-grid,
    .games-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

/* 容器布局 */
.container {
    display: flex;
    gap: 20px;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    align-items: stretch;
    background-color: #ffffff;
}

/* 侧边栏样式 */
.sidebar {
    width: 250px;
    flex-shrink: 0;
    background-color: #ffffff; /* 白色侧边栏 */
    border-radius: 8px;
    padding: 20px;
    height: auto;
    position: sticky;
    top: 80px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0f2e9; /* 浅绿色边框 */
}

.sidebar-section {
    margin-bottom: 25px;
    background-color: #fff;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(255, 165, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 300px;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-section h3 {
    color: #27ae60; /* 绿色标题 */
    margin-bottom: 15px;
    font-size: 18px;
    padding-bottom: 8px;
    border-bottom: 2px solid #a3e4d7; /* 浅绿色下划线 */
}

.sidebar-section ul {
    list-style: none;
}

.sidebar-section ul li {
    margin-bottom: 10px;
}

.sidebar-section ul li a {
    display: flex;
    align-items: center;
    padding: 8px 0;
    color: #555;
    transition: color 0.3s, transform 0.2s;
}

.sidebar-section ul li a:hover {
    color: #ff9933; /* 橙色悬停效果 */
    transform: translateX(5px);
}

.icon {
    margin-right: 10px;
    font-style: normal;
}

/* 最近玩过的游戏样式 */
.recent-games li a {
    display: flex;
    align-items: center;
    gap: 10px;
}

.recent-games img {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
    border: 2px solid #ffe4cc;
}

/* 主要内容区域调整 */
main {
    flex: 1;
    margin: 0;
    height: auto;
}

/* 响应式设计调整 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: static;
        margin-bottom: 20px;
    }

    .sidebar-section ul li a:hover {
        transform: none;
    }
}

/* 上传按钮样式 */
.upload-btn {
    background-color: #ff9933; /* 橙色上传按钮 */
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
}

.upload-btn:hover {
    background-color: #e67e22; /* 深橙色悬停效果 */
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.close:hover {
    color: #333;
}

/* 表单样式 */
.upload-form {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group input[type="file"] {
    display: block;
    margin-top: 5px;
}

.file-hint {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-start;
}

.btn-primary {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #219653;
}

.btn-cancel {
    background-color: #e0e0e0;
    color: #333;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-left: 10px;
    transition: background-color 0.3s;
}

.btn-cancel:hover {
    background-color: #d0d0d0;
}

.form-links {
    margin-top: 15px;
    text-align: center;
}

.form-links a {
    color: #27ae60;
    text-decoration: none;
    margin: 0 8px;
    font-size: 14px;
}

.form-links a:hover {
    text-decoration: underline;
}

.social-login {
    margin-top: 25px;
    text-align: center;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.social-login p {
    margin-bottom: 15px;
    color: #666;
}

.social-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
}

.social-btn:hover {
    opacity: 0.9;
}

.social-btn.wechat {
    background-color: #07C160;
    color: white;
}

.social-btn.qq {
    background-color: #12B7F5;
    color: white;
}

/* 用户登录后的样式 */
.user-profile {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.username {
    color: #eedf10;
    font-weight: 500;
    padding: 5px 10px;
    display: inline-block;
    border: 1px solid #ffffff;
    border-radius: 8px;
}

.username:hover {
    background-color: #f5f5f5;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 150px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 100;
    margin-top: 5px;
    border: 1px solid #eee;
}

.user-profile:hover .user-dropdown {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s;
}

.user-dropdown a:hover {
    background-color: #f5f5f5;
    color: #27ae60;
}

.user-dropdown a:not(:last-child) {
    border-bottom: 1px solid #eee;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 自定义文件上传按钮样式 */
.custom-file-upload {
    display: inline-block;
    padding: 8px 16px;
    background-color: #27ae60;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.custom-file-upload:hover {
    background-color: #219653;
}

.file-name {
    margin-left: 10px;
    font-size: 14px;
    color: #666;
}

.file-preview {
    margin-top: 10px;
    width: 100px;
    height: 100px;
    background-color: #f8f9fa;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* 错误消息样式 */
.error-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
}

/* 用户登录注册按钮样式 */
.user-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 20px;
}

.login-btn, .register-btn {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.7);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
    transition: background-color 0.3s, border-color 0.3s;
}

.login-btn:hover, .register-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: white;
}

/* 关闭按钮 */
.close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #888;
}

.close-button:hover {
    color: #333;
}

/* 表单通用样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

/* 提交按钮在某些场景下可能需要100%宽度 */
.form-actions .btn-full-width {
    width: 100%;
}

/* 上传进度条样式 */
.upload-progress-container {
    width: 100%;
    height: 24px;
    background-color: #f5f5f5;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.upload-progress-bar {
    height: 100%;
    background-color: #27ae60;
    color: white;
    text-align: center;
    line-height: 24px;
    font-size: 12px;
    transition: width 0.3s ease;
    width: 0%;
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 40px 40px;
    animation: progress-bar-stripes 2s linear infinite;
}

@keyframes progress-bar-stripes {
    from {
        background-position: 40px 0;
    }
    to {
        background-position: 0 0;
    }
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    z-index: 10000;
    max-width: 300px;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.notification.success {
    background-color: #4CAF50;
    color: white;
}

.notification.error {
    background-color: #f44336;
    color: white;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* 导航按钮统一样式 */
.nav-btn {
    background-color: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.7);
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    font-weight: 500;
    text-align: center;
    display: inline-block;
}

.nav-btn:hover, .nav-btn.active {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: white;
    color: white;
}

.nav-links a.nav-btn {
    padding: 8px 15px;
    text-decoration: none;
}